<?php

/*
 * @author Donald Barclay
 * @published 18 March 2014
 * This is a class used to define what a month is (a collection of days)
 * A day is a collection of timeslots
 * A method to build a day and make sure a month object can only have max days
 * Some commented sections are a work in progress, and code needs to be written.
 */
class month{
    
   private $day;
   private $monthID;
   private $maxDays;
   private $monthAlpha;
   private $yearID;
    
}

function _constructor($m,$max,$y){
    $this-> monthID = $m;
    $this-> day = 0;//counter used to number the days in a month and limit to maxDays
    $this-> maxDays = $max-1;
    $this-> yearID = $y;
}

function setMonthID($id){
    $this->monthID = $id;
}
function getMonthID(){
    return $this->monthID;
}
function setMaxDays($max){
    $this->maxDays = $max;
}
function getMaxDays(){
    return $this->maxDays;
}

function buildMonthSchedule(){
   
   $days = array();
  
 for ($day=0;$day<$this->getmaxDays();++$day){
     $timeSlots = array();
        for ($i=0;$i<32;++$i){//Creates 8 hours worth of 15 min timeslots a day
           $newTimeSlot = new timeSlot($i,null,null,$this->getMonthID(),$day);
           $timeSlots[i] = $newTimeSlot;//add new timeSlot to array
        }
        $days[$day] = $timeSlots;   
   }
  return $days; 
 } 